/**
 * 脚本
 *
 * @author bian
 * @createDate 2016.9.11
 */

var path = require("path");

var co = require("co");

var task = require("./task/index");

// --harmony 不是process argv 中的，很奇怪
var action = process.argv[2];
var appName = process.argv[3];

co(function*() {
    action == "start" ?  yield task.startWorkflow(appName) : yield task.stopWorkflow(appName);
    console.log("finish");
}).catch((err) => {
    console.error(err);
});